/*
 * @Author: funlee
 * @Email: i@funlee.cn
 * @Date: 2018-05-06 17:06:49
 * @Description: 对象的多态性 
 */
var log = console.log.bind();
log('---对象的多态性---')

var makeSound = function (animal) {
  animal.sound();
}

var Duck = function () { }
Duck.prototype.sound = function () {
  log('嘎嘎嘎...')
}

var Chicken = function () { }
Chicken.prototype.sound = function () {
  log('咯咯咯...')
}

makeSound(new Duck())
makeSound(new Chicken())


